Here is how to save the message list as an HTML file with the columns
Lines/Subject/Author/Date.
This works whether or not the bodies have been downloaded.
This requires Agent 4.2 or later.
1. In the message list pane, select the messages
whose headers you want to save.
2. Use "File >> Import and Export >> Export NZB File"
to save those headers as an NZB file.
3. Copy and save the text between the squiggly lines below
as an HTML file "nzb2htm.htm".
4. Open the file "nzb2htm.htm" in Firefox or Chrome.
For this step, do not use IE or Edge.
(The HTML message list can be viewed in IE or Edge after it
has been converted, but IE and Edge do not have what it takes
to do the conversion from NZB to HTML.)
You will see a button labelled "Open NZB file:".
5. Click this button and select the NZB file which you saved in step 2.
If you have selected a valid NZB file, you will now see
another button labelled "Save HTM file:".
6. Click the button "Save HTM file" and save the HTML file with the
message list headers.
You can open this saved HTML message list file in any browser you like
including IE, Edge, Firefox, and Chrome.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>% nzb2htm.htm %<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!DOCTYPE html>
<html lang="en">
<!-- saved from url=(0014)about:internet -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<title>NZB to HTML message list</title>
<script type="text/javascript">
function escapeHtml(s){
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'") .replace(/\r/g, "
").replace(/\n/g, "
").replace(/\t/g, "	") ;
}
/* Convert Unix dates to local time zone dates, in the Date column of the HTML output */
function convertDates(newDocument) {
var myNodeList = newDocument.getElementsByTagName("td");
for ( var i = 0 ; i < myNodeList.length ; ++i ){
var cell = myNodeList[i];
if ( cell != null && cell.hasAttribute("x-unixtime") ){
var dt = new Date( 1000 * cell.getAttribute("x-unixtime") );
cell.innerHTML = escapeHtml( dt.toLocaleDateString() + " " + dt.toLocaleTimeString() );
cell.removeAttribute("x-unixtime");
}
}
}
/* Transform the user's NZB file to HTML */
function convertNZBtoHTML( nzbFileText, infile, outfile ) {
var nzbDocument = (new DOMParser()).parseFromString(nzbFileText,"text/xml");
var xslStylesheetText = document.getElementById("xslt2html").textContent;
var xslStylesheet = (new DOMParser()).parseFromString(xslStylesheetText,"text/xml");
var myXSLTProcessor = new XSLTProcessor();
myXSLTProcessor.importStylesheet(xslStylesheet);
var newDocument = myXSLTProcessor.transformToDocument(nzbDocument);
if ( newDocument == null ){
/* MS-Edge pretends to support transformToDocument but fails when you need it */
document.getElementById("browserwarn").style.display="block";
document.getElementById("browserok").style.display = "none" ;
return;
}
if ( (newDocument.documentElement.nodeName.toLowerCase() != 'html') ||
(newDocument.documentElement.querySelector('body > div > table > colgroup > col') == null ) ) {
/* The input file is not a valid NZB file */
document.getElementById("badfilename").innerHTML = escapeHtml(infile);
document.getElementById("badfile").style.display = "block" ;
document.getElementById("dataurldiv").style.display = "none" ;
return;
} else {
document.getElementById("badfile").style.display = "none" ;
}
/* Convert the message dates in the output from Unix time integers to readable format */
convertDates(newDocument);
/* Let the user download the HTML output. Displaying on screen no work well in Chrome. */
var newDocAsString = "<!DOCTYPE html>\r\n<!-- saved from url=(0014)about:internet -->\r\n" + newDocument.documentElement.outerHTML ;
var dataUrl = "data:text/html;," + newDocAsString.replace(/%/g, "%25").replace(/\x0D/g, "%0D").replace(/\x0A/g, "%0A").replace(/[ \x09]/g, "%20").replace(/[\x00-\x1F]/g, "").replace(/#/g, "%23") ;
document.getElementById("dataurllink").setAttribute("download", outfile);
document.getElementById("dataurllink").href = dataUrl ;
document.getElementById("dataurldiv").style.display = "block" ;
}
/* Process the input file. Triggered when the user chooses a file to process. */
function processInputFile(files){
if ( files.length == 0 ){
return;
}
var infilename = files[0].name ;
var outfilename = infilename.replace(/\.nzb$/i,"") + ".htm";
var reader = new FileReader();
reader.onload = function(){
convertNZBtoHTML( this.result, infilename, outfilename );
}
reader.readAsText(files[0], "utf-8");
}
function resetFileInput(){
document.getElementById("fileform").reset();
}
function initialize(){
resetFileInput();
if ( window.FileReader && window.FileList && window.DOMParser && window.DOMParser.prototype.parseFromString && window.XSLTProcessor ){
document.getElementById("browserok").style.display="block";
}
else {
document.getElementById("browserwarn").style.display="block";
}
}
</script>
</head>
<body onload="initialize()">
<h1>NZB to HTML message list</h1>
<noscript>
<hr />
<h2>JavaScript required</h2>
<p>This browser-based application requires JavaScript.</p>
<p>To use this application, enable JavaScript and then reload this page.</p>
</noscript>
<div id="browserwarn" style="display: none;">
<hr />
<h2>Unsupported browser or version</h2>
Suggest you use one of the following desktop browsers:
<ul>
<li>Firefox (Mozilla Firefox)</li>
<li>Chrome (Google Chrome)</li>
</ul>
</div>
<div id="browserok" style="display: none;">
<form id="fileform">
<label>Open NZB file: <input type="file" id="fileinput" accept=".nzb" onchange="processInputFile(this.files)" /></label>
</form>
<hr />
<div id="badfile" style="display: none;">
<h2 style="color: #FF0000;">Not a valid NZB file: <i id="badfilename"> </i></h2>
</div>
<div id="dataurldiv" style="display: none;">
<!--
<label>Save HTM file: <a id="dataurllink" href="" download="Headers.htm" type="text/html"
style="-moz-appearance: button; -webkit-appearance: button; appearance: button; text-decoration: none; color: initial;">Download...</a></label> --><!-- TODO 'appearance' removed from CSS3 -->
<label>Save HTM file: <a id="dataurllink" href="" download="Headers.htm" type="text/html"
style="text-decoration: none;"><button type="button">Download...</button></a></label>
</div>
</div>
<script id="xslt2html" type="text/xml" style="display:none;">
<xsl:stylesheet version="1.0" xmlns:nzbns="
http://www.newzbin.com/DTD/2003/nzb" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0" encoding="utf-8" />
<xsl:template match="/nzbns:nzb">
<xsl:element name="html">
<xsl:element name="head">
<xsl:element name="title">Message Headers</xsl:element>
</xsl:element>
<xsl:element name="body">
<div>
<table border="0" width="100%">
<colgroup>
<col width="0%" />
<col width="66%" />
<col width="33%" />
<col width="0%" />
</colgroup>
<thead style="display: table-header-group;">
<tr>
<th style="border-bottom: 2px solid #808080;">Lines</th>
<th style="border-bottom: 2px solid #808080; text-align: left;">Subject</th>
<th style="border-bottom: 2px solid #808080; text-align: left;">Author</th>
<th style="border-bottom: 2px solid #808080; text-align: left;">Date</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="nzbns:file">
<tr style="vertical-align: top;">
<xsl:variable name="agentguessbytes" select="sum(nzbns:segments/nzbns:segment/@bytes)" />
<xsl:variable name="countsegments" select="count(nzbns:segments/nzbns:segment)" />
<xsl:choose>
<xsl:when test="$agentguessbytes <= 400 * $countsegments">
<td style="text-align: right;"><xsl:value-of select="round($agentguessbytes div 40)"/></td>
</xsl:when>
<xsl:otherwise>
<td style="text-align: right;"><xsl:value-of select="floor(10 * $countsegments + ($agentguessbytes - 400 * $countsegments) div 128)"/></td>
</xsl:otherwise>
</xsl:choose>
<td style="padding-left: 0.5em;"><xsl:value-of select="@subject"/></td>
<td style="padding-left: 0.5em;"><xsl:value-of select="@poster"/></td>
<td style="padding-left: 0.5em; white-space: nowrap;" x-unixtime="{@date}"></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
</script>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>% nzb2htm.htm %<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Kind regards
Ralph